﻿using System;
using System.Windows.Forms;
using BLL;

namespace UI
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void LogButton_Click(object sender, EventArgs e)
        {
            try
            {
                //取出用户界面的数据
                string userName = NameTextBox.Text.Trim();
                string password = PasswordTextBox.Text.Trim();
                BLL.LoginManager mgr=new LoginManager();
                //使用用户界面数据 进行查找
                Model.UserInfo user = mgr.UserLogin(userName, password);
                //如果没有问题，则登陆成功
                MessageBox.Show("登陆用户：" + user.UserName);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
    }
}
